{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import math\n",
    "from sklearn.preprocessing import StandardScaler,MinMaxScaler\n",
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Dataset():\n",
    "    \n",
    "    def __init__(self,file,scaleMethod):\n",
    "        self.file = file\n",
    "        self.scaleMethod = scaleMethod\n",
    "        \n",
    "    def importDataset(self,normalised=True):\n",
    "        \n",
    "        data = pd.read_csv(self.file)\n",
    "        dataS = data.drop('Unnamed: 0',axis=1)\n",
    "        self.normalise = normalised\n",
    "        if not normalised:\n",
    "            X = dataS.iloc[:,:7].values\n",
    "            Y = dataS.iloc[:,7:].values\n",
    "            X_train,X_test,Y_train,Y_test = train_test_split(X,Y,test_size=0.2,random_state=42)\n",
    "        \n",
    "        elif self.scaleMethod == 'Standard':\n",
    "            self.scaler = StandardScaler()\n",
    "            self.scaler.fit(dataS)\n",
    "            dataS = self.scaler.transform(dataS)\n",
    "            X = dataS[:,:7]\n",
    "            Y = dataS[:,7:]\n",
    "            X_train,X_test,Y_train,Y_test = train_test_split(X,Y,test_size=0.2,random_state=42)\n",
    "    \n",
    "        elif self.scaleMethod == 'MinMax':\n",
    "            self.scaler = MinMaxScaler(feature_range=(0,1))\n",
    "            self.scaler.fit(dataS)\n",
    "            dataS = self.scaler.transform(dataS)\n",
    "            X = dataS[:,:7]\n",
    "            Y = dataS[:,7:]\n",
    "            X_train,X_test,Y_train,Y_test = train_test_split(X,Y,test_size=0.2,random_state=42)\n",
    "\n",
    "        return X_train,X_test,Y_train,Y_test\n",
    "    \n",
    "    def inverseTransform(self,*arr):\n",
    "        \n",
    "        data = np.concatenate(arr,axis=1)\n",
    "        data = pd.DataFrame(data)\n",
    "        arrInverse = self.scaler.inverse_transform(data)\n",
    "\n",
    "        return arrInverse\n",
    "    \n",
    "    def cost(self,y_test,y_pred):\n",
    "\n",
    "        error = (y_test-y_pred)/y_test\n",
    "        error = np.sum(abs(error))/(y_test.shape[0]*y_test.shape[1])*100\n",
    "        \n",
    "        return error\n",
    "    \n",
    "    def rmse(self,y_test,y_pred):\n",
    "        error = np.sum((y_test-y_pred)**2)\n",
    "        error = error/(y_test.shape[0]*y_test.shape[1])\n",
    "        error = math.sqrt(error)\n",
    "        return error\n",
    "    \n",
    "    def errorMagnitude(self,y_true,y_pred):\n",
    "    \n",
    "        minMag = min([min(abs(i)) for i in y_true-y_pred])\n",
    "        maxMag = max([max(abs(i)) for i in y_true-y_pred])\n",
    "\n",
    "        return (minMag,maxMag)\n",
    "    \n",
    "    def train(self,X_train,Y_train,X_test,Y_test,Model,giveMagnitude=False):\n",
    "        \n",
    "        Ytr_pred = Model.predict(X_train.T).T\n",
    "        Yts_pred = Model.predict(X_test.T).T\n",
    "        \n",
    "        if not self.normalise:\n",
    "            error = self.rmse(Y_test,Yts_pred)\n",
    "            error_tr = self.rmse(Y_train,Ytr_pred)\n",
    "\n",
    "            if giveMagnitude:\n",
    "                magnitude = self.errorMagnitude(Y_test,Yts_pred)\n",
    "                return (error_tr,error,magnitude)\n",
    "        else:\n",
    "            true = self.inverseTransform(X_train,Y_train)\n",
    "            pred = self.inverseTransform(X_train,Ytr_pred)\n",
    "\n",
    "            error_tr = self.rmse(true[:,7:],pred[:,7:])\n",
    "\n",
    "            true = self.inverseTransform(X_test,Y_test)\n",
    "            pred = self.inverseTransform(X_test,Yts_pred)\n",
    "\n",
    "            error = self.rmse(true[:,7:],pred[:,7:])\n",
    "\n",
    "            if giveMagnitude:\n",
    "                magnitude = self.errorMagnitude(true[:,7:],pred[:,7:])\n",
    "                return (error_tr,error,magnitude)\n",
    "\n",
    "        return (error_tr,error)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "class ELM():\n",
    "    \n",
    "    def __init__(self,nodes):\n",
    "        self.neurons = nodes\n",
    "    \n",
    "    def sigmoid(self,z):\n",
    "        \n",
    "        s = 1/(1+np.exp(-z))\n",
    "        return s\n",
    "    \n",
    "    def tanh(self,z):\n",
    "        s = np.tanh(z)\n",
    "        return s\n",
    "    \n",
    "    def initlialization(self,X):\n",
    "        value = 1/math.sqrt(X.shape[0])\n",
    "        self.W = np.random.uniform(-value,value,(self.neurons,X.shape[0]))\n",
    "        self.b = np.random.randn(self.neurons,1)\n",
    "        \n",
    "    def fit(self,X,Y):\n",
    "        \n",
    "        self.initlialization(X)\n",
    "        z = np.dot(self.W,X)+self.b\n",
    "        H = self.sigmoid(z)\n",
    "        self.B = np.dot(Y,np.linalg.pinv(H))\n",
    "    \n",
    "    def predict(self,X):\n",
    "        z = np.dot(self.W,X)+self.b\n",
    "        H = self.sigmoid(z)\n",
    "        y_pred = np.dot(self.B,H)\n",
    "        \n",
    "        return y_pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "values = []\n",
    "dataClass = Dataset(file='Dataset/Static_Model/15000DwithQuat.csv',scaleMethod='MinMax')\n",
    "X_train,X_test,Y_train,Y_test = dataClass.importDataset()\n",
    "for i in range(10,100):\n",
    "    elm = ELM(nodes=i)\n",
    "    elm.fit(X_train.T,Y_train.T)\n",
    "    val = dataClass.train(X_train,Y_train,X_test,Y_test,elm,giveMagnitude=True)\n",
    "    values.append(val)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x2b2a64abac0>]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAA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/uHAzXRqt8QmwtcJCLlWF1wp4vIEyTu+QDr/0mlMeaD8PNnsQI+Uc/JmcA2Y0ytMcYPLAROJA7PR6wF+kfAeBEZLSIurAsbL0a5TkNKRASrb7TMGHNXr10vAl8NP/4q8MJQ1y0ajDE/MsaMNMaUYP17eMsYcxUJej4AjDG7gQoRmRjedAawnsQ9JzuAOSKSHP7/cwbWtae4Ox8xN1NURM7D6jO1A48YY+6Ibo2GloicBLwHrKWnz/jHWP3ofweKsf4Bf9EY0xCVSkaJiJwKfN8Yc4GI5JDA50NEZmBdJHYBW4FrsRpwCXlOROQXwJewRol9DFwPpBJn5yPmAl0ppdTAYq3LRSml1D5ooCulVJzQQFdKqTihga6UUnFCA10ppeKEBrpSSsUJDXSllIoT/w8JEwj+N2bSswAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot([i[1] for i in values])\n",
    "plt.plot([i[0] for i in values])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(2.4766539567534624,\n",
       "  2.4756455467629737,\n",
       "  (0.0004749282104601349, 8.231545122295117)),\n",
       " (2.633865531340613,\n",
       "  2.633167403195902,\n",
       "  (0.00020126136505105308, 6.590269229455133)),\n",
       " (2.4377582987024335,\n",
       "  2.431416199613788,\n",
       "  (0.00025201258213414235, 10.49116865897195)),\n",
       " (2.6202926278519367,\n",
       "  2.619555177612209,\n",
       "  (0.00043426775795119, 6.423848064842957)),\n",
       " (2.5350263358132836,\n",
       "  2.529260439963038,\n",
       "  (3.6680677727218836e-05, 7.011361203390438)),\n",
       " (2.0047804256676818,\n",
       "  1.977579093144424,\n",
       "  (0.000359077184461043, 8.681368185198432)),\n",
       " (2.1339623742076292,\n",
       "  2.106906988371499,\n",
       "  (5.313962255115712e-05, 9.726567236601081)),\n",
       " (2.0777391200194404,\n",
       "  2.0547677750054336,\n",
       "  (0.0002134706358187799, 7.143752030105205)),\n",
       " (1.9127466698767854,\n",
       "  1.886437237902324,\n",
       "  (0.00017964717257523688, 7.75816982853854)),\n",
       " (1.9363223374354643,\n",
       "  1.905891092476241,\n",
       "  (0.0005425528633917764, 5.811962489272927)),\n",
       " (1.9300480354772183,\n",
       "  1.9098787717297694,\n",
       "  (0.00014926707041418297, 6.6843678083941445)),\n",
       " (1.8821735440758176,\n",
       "  1.8589968031173414,\n",
       "  (5.9918763371413775e-05, 5.9347164789608815)),\n",
       " (1.8768296369317363,\n",
       "  1.8515000839735585,\n",
       "  (3.276343635505441e-05, 5.851142371802958)),\n",
       " (1.8841443930855208,\n",
       "  1.8595883648395857,\n",
       "  (0.00037055325652701754, 5.859415750091799)),\n",
       " (1.8747792636796794,\n",
       "  1.8505324964480325,\n",
       "  (0.00011929857438985891, 5.828551941462976)),\n",
       " (1.8736198256657288,\n",
       "  1.8496262564806554,\n",
       "  (0.0006266208172185372, 5.783442771062527)),\n",
       " (1.9272954897579704,\n",
       "  1.899826784481448,\n",
       "  (0.000639522392084757, 7.599968644424658)),\n",
       " (1.8725644228359104,\n",
       "  1.8498810199757243,\n",
       "  (0.0004046594475681786, 5.7842045101982595)),\n",
       " (1.8727922636422443,\n",
       "  1.8486650466172805,\n",
       "  (0.0003919772121268039, 5.778205657092698)),\n",
       " (1.8726835056431206,\n",
       "  1.8490348478827028,\n",
       "  (0.00010214120153761996, 5.780487928827295)),\n",
       " (1.8731735295622762,\n",
       "  1.8497158323038203,\n",
       "  (2.933306810781744e-05, 5.797058281605354)),\n",
       " (1.8724621538370343,\n",
       "  1.849306814117285,\n",
       "  (0.00026556566614743815, 5.785983775739183)),\n",
       " (1.8725910888573738,\n",
       "  1.849772613421848,\n",
       "  (0.0009149656148537133, 5.774630255333463)),\n",
       " (1.8725308033109807,\n",
       "  1.849678529677289,\n",
       "  (0.0006514339817522696, 5.793630568029041)),\n",
       " (1.8740697213919646,\n",
       "  1.8510885049975112,\n",
       "  (0.00022266646377033794, 5.874088279268353)),\n",
       " (1.8724726502508104,\n",
       "  1.8487791907520479,\n",
       "  (0.000893496684998496, 5.775628306643011)),\n",
       " (1.8717734771811094,\n",
       "  1.8477589398873566,\n",
       "  (0.00021805088960213936, 5.781821970740072)),\n",
       " (1.8718655659412482,\n",
       "  1.8495522732044516,\n",
       "  (5.67193811882305e-05, 5.778860529723461)),\n",
       " (1.8723510424942942,\n",
       "  1.849967015411075,\n",
       "  (0.00011392223318296146, 5.802687110104472)),\n",
       " (1.871771863980696,\n",
       "  1.849575045260262,\n",
       "  (0.00036871141200300883, 5.803809443886527)),\n",
       " (1.8707867307419528,\n",
       "  1.8508402785846603,\n",
       "  (0.00011062146997176114, 5.817993067184222)),\n",
       " (1.8698357073533303,\n",
       "  1.8456480169507854,\n",
       "  (0.0013671596178941314, 5.705172465667847)),\n",
       " (1.8683954465287271,\n",
       "  1.850219723035898,\n",
       "  (8.690664944488447e-05, 5.743530511657541)),\n",
       " (1.8710110960036253,\n",
       "  1.8498261911226352,\n",
       "  (6.939706844732996e-05, 5.792918830936998)),\n",
       " (1.8712300530923978,\n",
       "  1.8497962215978885,\n",
       "  (0.0008808255746579619, 5.810618486061694)),\n",
       " (1.8707319615745928,\n",
       "  1.8486300207939563,\n",
       "  (0.0004734601320883769, 5.804217297751743)),\n",
       " (1.8698054281598577,\n",
       "  1.8474107186796684,\n",
       "  (0.0011315209940043758, 5.8182145874942535)),\n",
       " (1.867961103781559,\n",
       "  1.8444878202862058,\n",
       "  (0.001183990933203205, 5.703435798895484)),\n",
       " (1.8523713672181936,\n",
       "  1.834529576487639,\n",
       "  (0.00025511461417693226, 5.906596749707148)),\n",
       " (1.8678871744582366,\n",
       "  1.8473845169029435,\n",
       "  (1.070189619056805e-05, 5.754488682325423)),\n",
       " (1.8662838815952782,\n",
       "  1.8429005452974485,\n",
       "  (5.899135567766223e-05, 5.808822357520066)),\n",
       " (1.8436256742401804,\n",
       "  1.819634679928478,\n",
       "  (0.0006702373778288973, 5.784800396608254)),\n",
       " (1.8355723038422622,\n",
       "  1.8214013537834395,\n",
       "  (0.000524544744177291, 5.928278237447706)),\n",
       " (1.85786878810317,\n",
       "  1.8405497729091629,\n",
       "  (0.00012551042755148956, 5.973830750177232)),\n",
       " (1.8555057828019383,\n",
       "  1.8428726788609815,\n",
       "  (0.0007533390650600325, 7.31831789909841)),\n",
       " (1.8442342049047615,\n",
       "  1.8303242592621654,\n",
       "  (0.00041494817290121944, 5.704433217761956)),\n",
       " (1.8254747303820793,\n",
       "  1.8009969111061912,\n",
       "  (0.0006124133587235292, 7.433256231978852)),\n",
       " (1.8254762609993216,\n",
       "  1.8090818800877984,\n",
       "  (0.0007430407332567057, 5.771709717235286)),\n",
       " (1.8336992526795934,\n",
       "  1.8172884826920468,\n",
       "  (0.002008167774363301, 5.7696269823567405)),\n",
       " (1.8165623656628185,\n",
       "  1.7913028735721863,\n",
       "  (0.00019565834136514582, 5.837339883554234)),\n",
       " (1.8330662413166727,\n",
       "  1.816616612153306,\n",
       "  (0.0004916711974090049, 5.963832887965083)),\n",
       " (1.7614781413193836,\n",
       "  1.7392401479565907,\n",
       "  (0.00015626587263994907, 5.929557590328066)),\n",
       " (1.8011467550868283,\n",
       "  1.78296955835815,\n",
       "  (1.8698533084560154e-05, 5.6462863974727835)),\n",
       " (1.7209944989941013,\n",
       "  1.7055620087971892,\n",
       "  (4.195752897118155e-06, 5.9133745094903745)),\n",
       " (1.7651960609407367,\n",
       "  1.7547577283241396,\n",
       "  (0.0006584383369983016, 9.89516252688312)),\n",
       " (1.7780987607827523,\n",
       "  1.768108412567049,\n",
       "  (0.0002932089624927414, 5.71507315760517)),\n",
       " (1.7236611845101648,\n",
       "  1.7074492856646548,\n",
       "  (0.0003417143272130829, 5.815731617140257)),\n",
       " (1.7641282107260963,\n",
       "  1.7551408011898884,\n",
       "  (0.0007317261189108137, 5.829165857023019)),\n",
       " (1.7754596540454148,\n",
       "  1.756352486515417,\n",
       "  (2.3357345206420632e-05, 5.842289111519824)),\n",
       " (1.7199478044047387,\n",
       "  1.7032332850790541,\n",
       "  (0.000683851361369392, 5.646531628283807)),\n",
       " (1.7298526327980983,\n",
       "  1.717783135441822,\n",
       "  (0.00014213819489228285, 5.878902335583067)),\n",
       " (1.7408448669219883,\n",
       "  1.7379262452096067,\n",
       "  (0.00022297439877583258, 5.859298304791789)),\n",
       " (1.7148134026857553,\n",
       "  1.7015999426970234,\n",
       "  (4.561324281837642e-05, 5.74809734436106)),\n",
       " (1.743869459962631,\n",
       "  1.7304020493084096,\n",
       "  (9.06826322371046e-05, 8.206659436916146)),\n",
       " (1.7065211576824766,\n",
       "  1.6947226505598934,\n",
       "  (0.00013266074727269483, 5.862501571122918)),\n",
       " (1.7200143597268678,\n",
       "  1.708943720352396,\n",
       "  (0.000710971000486893, 5.76672825101492)),\n",
       " (1.708585351060357,\n",
       "  1.7010436328830076,\n",
       "  (0.00014123333688687012, 5.743281272281614)),\n",
       " (1.7107935583235396,\n",
       "  1.7032115388994549,\n",
       "  (0.0005964675275933473, 5.857723252150494)),\n",
       " (1.7149232666471397,\n",
       "  1.6999348949676418,\n",
       "  (2.7703759950981066e-05, 5.712479429545198)),\n",
       " (1.712234269725447,\n",
       "  1.6960911421715386,\n",
       "  (0.0002824062047785958, 5.662165395040686)),\n",
       " (1.7329539752397844,\n",
       "  1.7172200666544335,\n",
       "  (4.410120591202826e-05, 5.8687287027324135)),\n",
       " (1.7157154589317356,\n",
       "  1.7069697367009684,\n",
       "  (2.1576441669779456e-05, 5.7222906911856395)),\n",
       " (1.7245508037281894,\n",
       "  1.7155881265521293,\n",
       "  (9.276370259314604e-05, 5.764115255452442)),\n",
       " (1.701560323174707,\n",
       "  1.6909921316148269,\n",
       "  (0.0008885622689227546, 5.742143537079468)),\n",
       " (1.702064262715467,\n",
       "  1.6912725802691657,\n",
       "  (7.798129565017575e-05, 5.786196746403768)),\n",
       " (1.6989403689112876,\n",
       "  1.6872541297489503,\n",
       "  (0.0001427280486439031, 5.735517980207256)),\n",
       " (1.7157871729712169,\n",
       "  1.7074034421987434,\n",
       "  (0.0010147945473999442, 5.813500593134121)),\n",
       " (1.6998005393305216,\n",
       "  1.6903739573362493,\n",
       "  (0.00014563326855920877, 5.767788968355241)),\n",
       " (1.7042091876295,\n",
       "  1.6895963740433277,\n",
       "  (0.00028166284285191523, 5.828390124493506)),\n",
       " (1.7005234102028264,\n",
       "  1.688067396893957,\n",
       "  (0.0001223057014883011, 5.698076150136938)),\n",
       " (1.7014689810038133,\n",
       "  1.688674309970247,\n",
       "  (0.0001828298176498322, 5.6969882780653975)),\n",
       " (1.7016919596998992,\n",
       "  1.6907195359445493,\n",
       "  (0.00010382461859315129, 5.80780793935762)),\n",
       " (1.697732891630644,\n",
       "  1.6862091626197817,\n",
       "  (0.0004331290280319422, 5.760084476610089)),\n",
       " (1.6999443926115683,\n",
       "  1.6895316385469596,\n",
       "  (2.682390452868333e-05, 5.724381178242364)),\n",
       " (1.700982982635776,\n",
       "  1.6892318573142704,\n",
       "  (0.000734777592336755, 5.700731493914267)),\n",
       " (1.698240029206699,\n",
       "  1.688776657985736,\n",
       "  (0.0005959621591209441, 5.797741874027636)),\n",
       " (1.696717516187077,\n",
       "  1.6868295951374674,\n",
       "  (0.00016668114227158526, 5.881070359897253)),\n",
       " (1.701484355352588,\n",
       "  1.6869739697271866,\n",
       "  (0.0006948723520388, 5.7974204362665755)),\n",
       " (1.6962445141067675,\n",
       "  1.6808883760713038,\n",
       "  (1.0435380602302757e-05, 5.7108496589325455)),\n",
       " (1.6950447421404573,\n",
       "  1.6852971462761785,\n",
       "  (0.00016555027064413252, 5.829041882753229))]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train,X_test,Y_train,Y_test = dataClass.importDataset()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.08333333, 0.66666667, 0.08333333, 0.25      ],\n",
       "       [0.        , 0.41666667, 0.16666667, 0.83333333],\n",
       "       [1.        , 0.91666667, 0.        , 1.        ],\n",
       "       ...,\n",
       "       [0.66666667, 0.91666667, 0.41666667, 0.33333333],\n",
       "       [0.66666667, 0.5       , 0.5       , 0.58333333],\n",
       "       [0.58333333, 0.91666667, 1.        , 0.5       ]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y_train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "values = []\n",
    "dataClass = Dataset(file='Dataset/Static_Model/15000DwithQuat.csv',scaleMethod='MinMax')\n",
    "X_train,X_test,Y_train,Y_test = dataClass.importDataset()\n",
    "elm = ELM(nodes=50)\n",
    "elm.fit(X_train.T,Y_train.T)\n",
    "y_pred = elm.predict(X_test.T)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "error = np.sum((Y_test.T-y_pred)**2)\n",
    "error = error/(Y_test.T.shape[0]*Y_test.T.shape[1])\n",
    "error = math.sqrt(error)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.153521491802687"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
